﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

namespace Maticsoft.Web.Admin.Shopping
{
    public partial class OrderDetail : PageBase
    {
        protected DataSet ds = null;
        string id = string.Empty;
        protected void Page_Load(object sender, EventArgs e)
        {
            Check("shopping", "read");

            if (!string.IsNullOrEmpty(Request.QueryString["id"]))
            {
                id = Request.QueryString["id"];
            }
            if (!IsPostBack)
            {
                GetData();
            }

            BindData();
        }

        protected void GetData()
        {
            string strWhere = "IsActive=1";
            if (!string.IsNullOrEmpty(id))
            {
                strWhere += " and OrderId=" + id;
            }
            BLL.Orders bll = new BLL.Orders();
            ds = bll.GetListV(strWhere);
        }

        protected void BindData()
        {
            string strWhere = "Oitems.IsActive=1 and OrderId=" + id;
            BLL.Oitems bll = new BLL.Oitems();
            DataSet oDs = bll.GetListV(strWhere);
            Repeater1.DataSource = oDs.Tables[0].DefaultView;
            Repeater1.DataBind();
        }
    }
}